package com.teamwork.ZuccEcho.Repository;


import com.teamwork.ZuccEcho.Entity.Info;
import com.teamwork.ZuccEcho.Entity.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface InformationApiRepository extends JpaRepository<Info,Long>, JpaSpecificationExecutor<Info> {
    @Query(value = "select * from student where stu_id =(select * from course_student where c_id=?1)", nativeQuery = true)
    List<Student> findStudentsByCourseId(long id);
}
